/*
 * @Author: Li Zengkun
 * @Date: 2022-09-26 19:24:16
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-09-26 19:28:40
 * @Description: 
 */
import axios from "axios"

// 添加商品至购物车
const add = (data) => axios.post('/cart', data)

// 购物车减少商品数量
const decrease = (id, data) => axios.put(`/cart/decrease/${id}`, data)

// 购物车删除商品
const remove = (id, params) => axios.delete(`/cart/${id}`, { params })

// 管理员注册
const increase = (id, data) => axios.put(`/cart/increase/${id}`, data)

// 获取购物车列表
const getList = (params) => axios.get('/cart/list', { params })

export default {
    remove,
    getList,
    add,
    decrease,
    increase
}